<template>
  <div>
    <button class="send" @click="btn">发送</button>
    <div class="name"></div>
    <h1>{{show}}</h1>
  </div>
</template>

<script>
import { mapMutations } from 'vuex'
export default {
  data() {
    show = ''
  },
  methods: {
    ...mapMutations(['add']),
    btn() {
      // const socket = new WebSocket("ws://localhost:8082");

      // socket.onopen = () => {
      //   socket.send("Hello! i am aaa");
      // };

      // socket.onmessage = (data) => {
      //   console.log(data);
      // };
      this.add('index')
    },
  },
  computed:{
    show(){
      return this.$store.state.last_page;
    }
  }
};
</script>

<style scoped>
</style>